package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author 李贺
 * @since 2019-12-10
 */
@TableName("tt_user_login")
public class TtUserLoginPO extends DMSBasePO<TtUserLoginPO> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "USER_LOGIN_ID", type = IdType.AUTO)
    private Long userLoginId;
    /**
     * 经销商公司id
     */
    @TableField("COMPANY_ID")
    private Long companyId;
    /**
     * 登录公司
     */
    @TableField("OWNER_CODE")
    private String ownerCode;
    /**
     *  职位
     */
    @TableField("USER_ORG_ID")
    private Long userOrgId;
    /**
     *  组织
     */
    @TableField("ORG_ID")
    private Long orgId;
    /**
     * 操作时间
     */
    @TableField("OPERATE_DATE")
    private LocalDateTime operateDate;
    /**
     * 操作员
     */
    @TableField("OPERATOR")
    private Long operator;
    /**
     * 登录方式
     */
    @TableField("LOGIN_WAY")
    private Integer loginWay;
    /**
     * 设备信息
     */
    @TableField("USER_AGENT")
    private String userAgent;
    /**
     * IP
     */
    @TableField("IP")
    private String ip;
    /**
     * 设备名称/PC浏览器名称
     */
    @TableField("DEVICE_NAME")
    private String deviceName;
    /**
     * 手机系统版本/pc的浏览器版本
     */
    @TableField("DEVICE_VERSION")
    private String deviceVersion;
    /**
     * 手机型号
     */
    @TableField("DEVICE_MODEL")
    private String deviceModel;
    /**
     * 系统平台
     */
    @TableField("OS_NAME")
    private String osName;
    /**
     * 浏览器类型
     */
    @TableField("BROWER_TYPE")
    private String browerType;
    /**
     * app版本
     */
    @TableField("APP_VERSION")
    private String appVersion;
    /**
     * app名称
     */
    @TableField("APP_NAME")
    private String appName;
    /**
     * 位置信息精度
     */
    @TableField("longitude")
    private String longitude;
    /**
     * 位置信息维度
     */
    @TableField("latitude")
    private String latitude;
    /**
     * 退出时间
     */
    @TableField("LOG_OUT_DATE")
    private LocalDateTime logOutDate;
    /**
     * 最后一次操作时间
     */
    @TableField("LAST_OPERATE_DATE")
    private LocalDateTime lastOperateDate;
    /**
     * JWT
     */
    @TableField("JWT")
    private String jwt;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;
    private String appId;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public TtUserLoginPO() {
        super();
    }


    public Long getUserLoginId() {
        return userLoginId;
    }

    public void setUserLoginId(Long userLoginId) {
        this.userLoginId = userLoginId;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public Long getUserOrgId() {
        return userOrgId;
    }

    public void setUserOrgId(Long userOrgId) {
        this.userOrgId = userOrgId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public LocalDateTime getOperateDate() {
        return operateDate;
    }

    public void setOperateDate(LocalDateTime operateDate) {
        this.operateDate = operateDate;
    }

    public Long getOperator() {
        return operator;
    }

    public void setOperator(Long operator) {
        this.operator = operator;
    }

    public Integer getLoginWay() {
        return loginWay;
    }

    public void setLoginWay(Integer loginWay) {
        this.loginWay = loginWay;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDeviceVersion() {
        return deviceVersion;
    }

    public void setDeviceVersion(String deviceVersion) {
        this.deviceVersion = deviceVersion;
    }

    public String getDeviceModel() {
        return deviceModel;
    }

    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }

    public String getOsName() {
        return osName;
    }

    public void setOsName(String osName) {
        this.osName = osName;
    }

    public String getBrowerType() {
        return browerType;
    }

    public void setBrowerType(String browerType) {
        this.browerType = browerType;
    }

    public String getAppVersion() {
        return appVersion;
    }

    public void setAppVersion(String appVersion) {
        this.appVersion = appVersion;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public LocalDateTime getLogOutDate() {
        return logOutDate;
    }

    public void setLogOutDate(LocalDateTime logOutDate) {
        this.logOutDate = logOutDate;
    }

    public LocalDateTime getLastOperateDate() {
        return lastOperateDate;
    }

    public void setLastOperateDate(LocalDateTime lastOperateDate) {
        this.lastOperateDate = lastOperateDate;
    }

    public String getJwt() {
        return jwt;
    }

    public void setJwt(String jwt) {
        this.jwt = jwt;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.userLoginId;
    }

    @Override
    public String toString() {
        return "TtUserLoginPO{" +
                "userLoginId=" + userLoginId +
                ", companyId=" + companyId +
                ", ownerCode=" + ownerCode +
                ", userOrgId=" + userOrgId +
                ", orgId=" + orgId +
                ", operateDate=" + operateDate +
                ", operator=" + operator +
                ", loginWay=" + loginWay +
                ", userAgent=" + userAgent +
                ", ip=" + ip +
                ", deviceName=" + deviceName +
                ", deviceVersion=" + deviceVersion +
                ", deviceModel=" + deviceModel +
                ", osName=" + osName +
                ", browerType=" + browerType +
                ", appVersion=" + appVersion +
                ", appName=" + appName +
                ", longitude=" + longitude +
                ", latitude=" + latitude +
                ", logOutDate=" + logOutDate +
                ", lastOperateDate=" + lastOperateDate +
                ", jwt=" + jwt +
                ", isDeleted=" + isDeleted +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author 李贺
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "userLoginId");
    }


}
